package app.kotlin_1.application

import android.app.Application
import android.support.multidex.MultiDexApplication
import app.kotlin_1.sql.SQLiteManager
import com.facebook.drawee.backends.pipeline.Fresco

/**
 * Created by 刘智强 on 2017/9/19.
 */
class MyApplicaiton : MultiDexApplication {
    constructor() : super()

    companion object {
        private var instance: MyApplicaiton? = null

        fun getInstance(): Application {
            synchronized(MyApplicaiton::class.java) {
                if (instance == null) {
                    instance = MyApplicaiton()
                }
            }
            return instance!!

        }
    }

    override fun onCreate() {
        super.onCreate()
        Fresco.initialize(this)
        initGreenDao()
    }

    private fun initGreenDao() {
        var instance = SQLiteManager.getInstangce(this)
        instance.getDaoSession()
    }


}